import 'package:xiongmao_clean_flutter_module/generated/json/base/json_convert_content.dart';
import 'package:xiongmao_clean_flutter_module/business/common/workpost/bean/work_rules_data_entity.dart';

WorkRulesDataEntity $WorkRulesDataEntityFromJson(Map<String, dynamic> json) {
  final WorkRulesDataEntity workRulesDataEntity = WorkRulesDataEntity();
  final String? maxAge = jsonConvert.convert<String>(json['max_age']);
  if (maxAge != null) {
    workRulesDataEntity.maxAge = maxAge;
  }
  final String? isEntryBeforeToday = jsonConvert.convert<String>(
      json['is_entry_before_today']);
  if (isEntryBeforeToday != null) {
    workRulesDataEntity.isEntryBeforeToday = isEntryBeforeToday;
  }
  final String? isUploadNotGuilty = jsonConvert.convert<String>(
      json['is_upload_not_guilty']);
  if (isUploadNotGuilty != null) {
    workRulesDataEntity.isUploadNotGuilty = isUploadNotGuilty;
  }
  final String? isEntrySign = jsonConvert.convert<String>(
      json['is_entry_sign']);
  if (isEntrySign != null) {
    workRulesDataEntity.isEntrySign = isEntrySign;
  }
  final String? payrollDate = jsonConvert.convert<String>(json['payroll_date']);
  if (payrollDate != null) {
    workRulesDataEntity.payrollDate = payrollDate;
  }
  final String? electronicContractStatus = jsonConvert.convert<String>(
      json['electronic_contract_status']);
  if (electronicContractStatus != null) {
    workRulesDataEntity.electronicContractStatus = electronicContractStatus;
  }
  final String? electronicContractStatusName = jsonConvert.convert<String>(
      json['electronic_contract_status_name']);
  if (electronicContractStatusName != null) {
    workRulesDataEntity.electronicContractStatusName =
        electronicContractStatusName;
  }
  return workRulesDataEntity;
}

Map<String, dynamic> $WorkRulesDataEntityToJson(WorkRulesDataEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['max_age'] = entity.maxAge;
  data['is_entry_before_today'] = entity.isEntryBeforeToday;
  data['is_upload_not_guilty'] = entity.isUploadNotGuilty;
  data['is_entry_sign'] = entity.isEntrySign;
  data['payroll_date'] = entity.payrollDate;
  data['electronic_contract_status'] = entity.electronicContractStatus;
  data['electronic_contract_status_name'] = entity.electronicContractStatusName;
  return data;
}

extension WorkRulesDataEntityExtension on WorkRulesDataEntity {
  WorkRulesDataEntity copyWith({
    String? maxAge,
    String? isEntryBeforeToday,
    String? isUploadNotGuilty,
    String? isEntrySign,
    String? payrollDate,
    String? electronicContractStatus,
    String? electronicContractStatusName,
  }) {
    return WorkRulesDataEntity()
      ..maxAge = maxAge ?? this.maxAge
      ..isEntryBeforeToday = isEntryBeforeToday ?? this.isEntryBeforeToday
      ..isUploadNotGuilty = isUploadNotGuilty ?? this.isUploadNotGuilty
      ..isEntrySign = isEntrySign ?? this.isEntrySign
      ..payrollDate = payrollDate ?? this.payrollDate
      ..electronicContractStatus = electronicContractStatus ??
          this.electronicContractStatus
      ..electronicContractStatusName = electronicContractStatusName ??
          this.electronicContractStatusName;
  }
}